package com.joysw.ui.fragment;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.RelativeLayout;
import butterknife.ButterKnife;
import butterknife.InjectView;
import butterknife.InjectViews;

import com.joysw.R;
import com.joysw.ui.MainActivity;
import com.joysw.ui.MyIncomeActivity;
import com.joysw.ui.MyOrderActivity;
import com.joysw.ui.MyPaymentsAccountActivity;
import com.joysw.ui.MyselfInfoActivity;
import com.joysw.view.TitleBarView;

/**
 * @Title: MeFragment.java
 * @Package com.joysw.ui.fragment
 * @Description: 我的
 * @author LIMINGYAN
 * @date 2015年3月28日 下午9:30:38
 * @version V1.0
 */
public class WdFragment extends BaseFragment implements OnClickListener {
	private static final String TAG = "WdFragment";
	private Context mContext;
	private View mBaseView;

	@InjectView(R.id.wd_title_bar)
	TitleBarView mTitleBar;
	@InjectView(R.id.my_order)
	RelativeLayout mOrder;
	@InjectView(R.id.my_income)
	RelativeLayout mIncome;
	@InjectView(R.id.myself_info)
	RelativeLayout myself_info;
	@InjectView(R.id.my_supplier)
	RelativeLayout mSupplier;
	@InjectView(R.id.my_share)
	RelativeLayout mShare;
	@InjectView(R.id.my_payment_account)
	RelativeLayout mPayment_account;
	
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		mContext = getActivity();
		mBaseView = inflater.inflate(R.layout.fragment_wd, container, false);
		ButterKnife.inject(this, mBaseView);
		initView();

		return mBaseView;
	}

	private void initView() {
		mTitleBar.setCommonTitle(View.GONE, View.VISIBLE, View.GONE);
		mTitleBar.setTitleText(R.string.fragment_wd_title);
		mOrder.setOnClickListener(this);
		mIncome.setOnClickListener(this);
		myself_info.setOnClickListener(this);
		mSupplier.setOnClickListener(this);
		mPayment_account.setOnClickListener(this);
		mShare.setOnClickListener(this);
	}

	@Override
	public void onClick(View arg0) {
		switch (arg0.getId()) {
		case R.id.my_order:
			Intent intent=new Intent(WdFragment.this.getActivity(),MyOrderActivity.class);
			startActivity(intent);
			break;
		case R.id.my_income:
			startActivity(new Intent(WdFragment.this.getActivity(),MyIncomeActivity.class));
			break;
		case R.id.myself_info:
			startActivity(new Intent(WdFragment.this.getActivity(),MyselfInfoActivity.class));
			break;
		case R.id.my_supplier:
			
			break;
		case R.id.my_collection:
			break;
		case R.id.my_payment_account:
			
			startActivity(new Intent(WdFragment.this.getActivity(),MyPaymentsAccountActivity.class));
			break;
		}
	
	}
}
